home *** CD-ROM | disk | FTP | other *** search
/ Utilities Professional 1-1500 / Utilities Professional 1-1500 (1994)(WPD)[!].iso / 07511000 / var0784.dms / var0784.adf / PopCLI4 / runparse.c < prev    next >
C/C++ Source or Header  |  1978-01-24  |  2KB  |  84 lines

  1. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  2. /* |_o_o|\\ Copyright (c) 1986 The Software Distillery.  All Rights Reserved */
  3. /* |. o.| || This program may not be distributed without the permission of   */
  4. /* | .  | || the authors.                                                    */
  5. /* | o  | ||    Dave Baker     Ed Burnette  Stan Chow    Jay Denebeim        */
  6. /* |  . |//     Gordon Keener  Jack Rouse   John Toebes  Doug Walker         */
  7. /* ======          BBS:(919)-471-6436      VOICE:(919)-469-4210              */ 
  8. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  9. /*
  10.  * VERY loosely based on the input.device example by Rob Peck, 12/1/85
  11.  */
  12.  
  13. #include "popcli.h"
  14. #include "popbug.h"
  15.  
  16.  
  17. #ifdef BUGMACROS
  18. BPTR __BugWindow;
  19. #endif
  20.  
  21. /************************************************************************/
  22. /* the main program to do the popcli stuff                              */
  23. /************************************************************************/
  24.  
  25. #undef global   /* Since it really is local in this routine */
  26.  
  27. void _main()
  28.    {
  29.    GLOBAL_DATA         global;
  30.    struct OURMSG       pmsg;   /* for AREXX message parsing */
  31.  
  32.    int rc;
  33.  
  34.    memset( (char *)&global, 0, sizeof(global) );
  35.    
  36.    DOSBase = (struct DosBase *)OpenLibrary("dos.library",0);
  37.  
  38.    global.stdout = Open("*",MODE_OLDFILE);
  39.  
  40.    rc = popparse( &global, "quit", &pmsg );
  41.    rc = popparse( &global, "add 0x00 cmd run lse", &pmsg );
  42.    rc = popparse( &global, "free 0x02", &pmsg );
  43.    rc = popparse( &global, "30", &pmsg );
  44.    rc = popparse( &global, "blank", &pmsg );
  45.    rc = popparse( &global, "add f7 minchip 50000 nowb cmd run lse", &pmsg );
  46.  
  47.    if (DOSBase)
  48.       CloseLibrary( (struct Library *)DOSBase );
  49. }
  50.  
  51. #ifdef BUGMACROS
  52. int     myprintf(fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9)
  53. char    *fmt;
  54. long    a1, a2, a3, a4, a5, a6, a7, a8, a9;
  55. {
  56.     int    bytes, fmtlen;
  57.     char    buff[512];
  58.  
  59.     if (__BugWindow <= 0) return(0);
  60.  
  61.     fmtlen = strlen(fmt);
  62.     if (fmtlen > 70)
  63.     {
  64.         bytes = sprintf(buff, "BUGMSG: 0x%x, length %d\n", fmt, fmtlen);
  65.         Write(__BugWindow, buff, bytes);
  66.         return(0);
  67.     }
  68.     else
  69.     {
  70.         bytes = sprintf(buff, "BUG(%s)\n", fmt);
  71.         Write(__BugWindow, buff, bytes);
  72.     }
  73.  
  74.     bytes = sprintf(buff, fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9);
  75.  
  76.     if (bytes < sizeof(buff))
  77.         Write(__BugWindow, buff, bytes);
  78.     else
  79.         Write(__BugWindow, "!!! msg too big - prepare to die\n",
  80.                 strlen("!!! msg too big - prepare to die\n"));
  81.     return(0);
  82. }
  83. #endif
  84.